<?php

/**
 * @name: HOTN Sponsor
 * @author: HammerOnTheNail
 * @link: http://code.google.com/p/hotnsponsor/
 */

require_once(e_HANDLER."ren_help.php");

if ( ($_POST['hotn_sponsor_max']<>"") )
{
	$update_arg = "
		`hotn_sponsor_options_max` = '".$_POST['hotn_sponsor_max']."',
		`hotn_sponsor_options_text` = '".$_POST['hotn_sponsor_text']."',
		`hotn_sponsor_options_bank` = '".$_POST['hotn_sponsor_bank']."',
		`hotn_sponsor_options_users_orderby` = '".$_POST['hotn_sponsor_users_orderby']."',
		`hotn_sponsor_options_users_ordertype` = '".$_POST['hotn_sponsor_users_ordertype']."'
	";
	$sql -> db_Update("hotn_sponsor_options",$update_arg." WHERE `hotn_sponsor_options_id` = '1'",false);
}

@include(e_PLUGIN."hotn_sponsor/options.php");

$title .= " - ".HOTN_SPONSOR_ADMIN_MENU_OPTIONS;

$text ="
	<form method='post' action='".$PHP_SELF."'>
		<table class='fborder'>
			<tr>
				<td class='forumheader3'>
					".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_MAX."
				</td>
				<td class='forumheader3' style='text-align: center;'>
					<input type='text' class='tbox' name='hotn_sponsor_max' value='".$_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_max']."' />
				</td>
			</tr>
			<tr>
				<td class='forumheader3'>
					".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERBY."
				</td>
				<td class='forumheader3' style='text-align: center;'>
					<select name='hotn_sponsor_users_orderby' class='tbox'>
						<option value='name' ".($_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_users_orderby']=="name"?"SELECTED":"").">".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERBY_NAME."</option>
						<option value='money' ".($_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_users_orderby']=="money"?"SELECTED":"").">".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERBY_MONEY."</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class='forumheader3'>
					".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERTYPE."
				</td>
				<td class='forumheader3' style='text-align: center;'>
					<select name='hotn_sponsor_users_ordertype' class='tbox'>
						<option value='asc' ".($_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_users_ordertype']=="asc"?"SELECTED":"").">".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERTYPE_ASC."</option>
						<option value='desc' ".($_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_users_ordertype']=="desc"?"SELECTED":"").">".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_ORDERTYPE_DESC."</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class='forumheader3'>
					".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_TEXT."
				</td>
				<td class='forumheader3'>
					<textarea name='hotn_sponsor_text' rows='10' cols='74' class='tbox' onkeyup='storeCaret(this);' onclick='storeCaret(this);' onselect='storeCaret(this);'>".$_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_text']."</textarea>
					<br />
					<input type='text' maxlength='100' size='90' name='help' class='helpbox' id='help' />
					<br />".display_help('help',"hotn_sponsor_text")."
				</td>
			</tr>
			<tr>
				<td class='forumheader3'>
					".HOTN_SPONSOR_ADMIN_SPONSOR_OPTIONS_BANK."
				</td>
				<td class='forumheader3'>
					<textarea name='hotn_sponsor_bank' rows='10' cols='74' class='tbox' onkeyup='storeCaret(this);' onclick='storeCaret(this);' onselect='storeCaret(this);'>".$_HOTN_SPONSOR_OPTIONS['hotn_sponsor_options_bank']."</textarea>
					<br />
					<input type='text' maxlength='100' size='90' name='help' class='helpbox' id='help' />
					<br />".display_help('help',"hotn_sponsor_bank")."
				</td>
			</tr>
			<tr>
				<td colspan='2' style='text-align: center;' class='forumheader' >
					<input type='submit' value='".HOTN_SPONSOR_ADMIN_SPONSOR_ADD_SUBMIT."' class='tbox' />
				</td>
			</tr>
		</table>
	</form>
";
?>